home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / ShutDown.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  2.6 KB  |  104 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ShutDown.p
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1987-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ShutDown;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __SHUTDOWN__}
  28. {$SETC __SHUTDOWN__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ShutDownIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __MIXEDMODE__}
  38. {$I MixedMode.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47. CONST
  48.     sdOnPowerOff                = 1;                            { call procedure before power off. }
  49.     sdOnRestart                    = 2;                            { call procedure before restart. }
  50.     sdOnUnmount                    = 4;                            { call procedure before unmounting. }
  51.     sdOnDrivers                    = 8;                            { call procedure before closing drivers. }
  52.     sdOnBootVolUnmount            = 16;                            { call procedure before unmounting boot volume and VM volume but after unmounting all other volumes }
  53.     sdRestartOrPower            = 3;                            { call before either power off or restart. }
  54.  
  55.  
  56. TYPE
  57. {$IFC TYPED_FUNCTION_POINTERS}
  58.     ShutDwnProcPtr = PROCEDURE(shutDownStage: INTEGER);
  59. {$ELSEC}
  60.     ShutDwnProcPtr = Register68kProcPtr;
  61. {$ENDC}
  62.  
  63.     ShutDwnUPP = UniversalProcPtr;
  64.  
  65. CONST
  66.     uppShutDwnProcInfo = $00001002;
  67.  
  68. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  69.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  70.     INLINE $2E9F;
  71.     {$ENDC}
  72.  
  73. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  74.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  75.     {To be implemented:  Glue to move parameters into registers.}
  76.     {$ENDC}
  77. PROCEDURE ShutDwnPower;
  78.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  79.     INLINE $3F3C, $0001, $A895;
  80.     {$ENDC}
  81. PROCEDURE ShutDwnStart;
  82.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  83.     INLINE $3F3C, $0002, $A895;
  84.     {$ENDC}
  85. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  86.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  87.     INLINE $3F3C, $0003, $A895;
  88.     {$ENDC}
  89. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  90.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  91.     INLINE $3F3C, $0004, $A895;
  92.     {$ENDC}
  93.  
  94. {$ALIGN RESET}
  95. {$POP}
  96.  
  97. {$SETC UsingIncludes := ShutDownIncludes}
  98.  
  99. {$ENDC} {__SHUTDOWN__}
  100.  
  101. {$IFC NOT UsingIncludes}
  102.  END.
  103. {$ENDC}
  104.